import {httpInstance} from "@/api/index";
import {getConfig, postConfig} from "@/lib/RequestBuilder";

const menu_prefix = "/sys_menu"


export const getMenuTree = () =>{
    let config = getConfig(menu_prefix+"/getPositiveMenuTree");
    return httpInstance.request(config)
}

export const addMenu = (param) =>{
    let config = postConfig(menu_prefix+"/add",param);
    return httpInstance.request(config)
}

export const deleteMenu = (param) =>{
    let config = postConfig(menu_prefix+"/delete",param);
    return httpInstance.request(config)
}


export const updateMenu = (param) =>{
    let config = postConfig(menu_prefix+"/update",param);
    return httpInstance.request(config)
}

export const updateSort = (param) =>{
    let config = postConfig(menu_prefix+"/updateSort",param);
    return httpInstance.request(config)
}

export const getMenu = (param) =>{
    let config = getConfig(menu_prefix+"/get",param);
    return httpInstance.request(config)
}